UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'quBJoMErvCbUZVIF8z+7n1IYDnO8K5KgUrSl8i0ynUo=' 
WHERE 
  key_id = '8cbeb6cf9ec837dea0f65e5f6628f1ef99354d21d2ee21ccee754bebd77f1cb6' 
  AND (
    token = 'quBJoMErvCbUZVIF8z+7n1IYDnO8K5KgUrSl8i0ynUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020