UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5uwvZ1cHlb+Wzql6AruYZ3pfSQRs0LOM4XK02mYcLk8=' 
WHERE 
  key_id = 'ca68a7173f83ac6f1415c2f218c3ae39df8dcd88a3b4e7ea43dc27d3e90e5acd' 
  AND (
    token = '5uwvZ1cHlb+Wzql6AruYZ3pfSQRs0LOM4XK02mYcLk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038