UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r2dqpvEsT0MkvrpnWBKqJnZJa7B6US3oH0/e7UvJD3I=' 
WHERE 
  key_id = 'f7eaed93d57d2e11c3df53bdf2b7c1ad5171210e8e8e39fba479da5b2ec84c73' 
  AND (
    token = 'r2dqpvEsT0MkvrpnWBKqJnZJa7B6US3oH0/e7UvJD3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033