UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l+sfW/94sMW9jhnJJNWkc5SBD6cthQUD5/fuyKqclLk=' 
WHERE 
  key_id = '7ae211b5c4e61d4784ecf6beeae52056c7d703211c7c0091e64b1d02b674b602' 
  AND (
    token = 'l+sfW/94sMW9jhnJJNWkc5SBD6cthQUD5/fuyKqclLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032