UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xiRmir2wOfc6PDf98/HSxRA1FBdXZkJJ9ZhhDk8SRno=' 
WHERE 
  key_id = '4ed9e9bd9280683286608bf303f0a94d0200acd26711f56e9493a627d1d8aef2' 
  AND (
    token = 'xiRmir2wOfc6PDf98/HSxRA1FBdXZkJJ9ZhhDk8SRno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025