UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HrMheMQcpuOrxMmfpjdhcO0AhV7x84Ae4nhGQwHjGdM=' 
WHERE 
  key_id = '4118b8e5576998b31882f1e1620a216f5129fd84b65050f1689bd0ccf89c6c22' 
  AND (
    token = 'HrMheMQcpuOrxMmfpjdhcO0AhV7x84Ae4nhGQwHjGdM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037