UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cyGIYwljjaozXSMpMWt/OIMKp0NWcoIWrWz16flnra8=' 
WHERE 
  key_id = '2ff226b823e8e9e869fe9fcfacc1661a82cd7d603c6d59cb0a0f136a61b7d3b8' 
  AND (
    token = 'cyGIYwljjaozXSMpMWt/OIMKp0NWcoIWrWz16flnra8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018