UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1qU54QkYbUgP0gmLJVVSrqLC2P/kRdKd9jI7qttujGM=' 
WHERE 
  key_id = '56e2eb859c1b37c9bf9720a2cbeecf3372b106b1330bcede4b8d1a4b11abecd3' 
  AND (
    token = '1qU54QkYbUgP0gmLJVVSrqLC2P/kRdKd9jI7qttujGM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019