UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FlffBH5YiJJjuEfQfXUa5+5qvpnBDnlAa1PetuRKnco=' 
WHERE 
  key_id = 'e69b9c951550ac280c7413f4f7146b83fa9e356e7d05c302aa0e14495ad35aab' 
  AND (
    token = 'FlffBH5YiJJjuEfQfXUa5+5qvpnBDnlAa1PetuRKnco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041