UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nJVnRLasB5cYFqC/gyODwqIDgtguXo5zfZr6Gfg9dZA=' 
WHERE 
  key_id = '8e4e4ef7069ae766b2dfc6ca4766f9067bcf0cdd3e751ed64f8575d3868a13a8' 
  AND (
    token = 'nJVnRLasB5cYFqC/gyODwqIDgtguXo5zfZr6Gfg9dZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035