UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'clZ8bhQmi5SW1YAzpRJOW9WAo52oESIYjo/ek4wVcIE=' 
WHERE 
  key_id = '5c4055e8987058da24e3c519844c67edc2c42d9bf25e03945b7d1e92b9eb1f8a' 
  AND (
    token = 'clZ8bhQmi5SW1YAzpRJOW9WAo52oESIYjo/ek4wVcIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020