UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j75vfIJvBOQ+pZEZ80qn7vYgBPZWtng+N+g9n0zBsi0=' 
WHERE 
  key_id = '2f1a3ec567189b9a0b21b85c60681200e3902181cb5d0ca130279e1eeca9ff1d' 
  AND (
    token = 'j75vfIJvBOQ+pZEZ80qn7vYgBPZWtng+N+g9n0zBsi0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029