UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RynXjMPe1Z+1G46IR0K/ZInZVOhfynYI7IfArEKQRls=' 
WHERE 
  key_id = '464bfcde85e926592468b1faa30a057640ef7f6d6f781536b9e9f13150d94fa3' 
  AND (
    token = 'RynXjMPe1Z+1G46IR0K/ZInZVOhfynYI7IfArEKQRls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049