UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C0c0g9EID8CtSCDLKM0jX8SoUB6M73g0zQfLeZYld8c=' 
WHERE 
  key_id = '7abeb8c715ddb54bbfa1fd3691ac278990a2455842ef6ff6d07bfbf67235a5d7' 
  AND (
    token = 'C0c0g9EID8CtSCDLKM0jX8SoUB6M73g0zQfLeZYld8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044