UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lok3qWQdG2J5mBZ2SxaPIxtJnMjO+Zk7FOvz2yL5Bqw=' 
WHERE 
  key_id = '8d2d8429778f714d0a03e209ab0b282cdbd6e9daf71d43be8fd703ea4d6c9a11' 
  AND (
    token = 'Lok3qWQdG2J5mBZ2SxaPIxtJnMjO+Zk7FOvz2yL5Bqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037