UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IwUYlqOncYpfx3SP2x8idjiFLAr0QEdhtaAfrN7kPMo=' 
WHERE 
  key_id = '95ffdb47c8332571d21f802df424cc1f6e4898b03e64e488672ed6545050120e' 
  AND (
    token = 'IwUYlqOncYpfx3SP2x8idjiFLAr0QEdhtaAfrN7kPMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025