UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6QNEgDdMrK8aTL/PSlcAbIVahEIoinAr0cophNQzqvI=' 
WHERE 
  key_id = 'cb8bbdc6a610e908a773af45a1c0ac1c868b44c126393b6a0907624e8c383e62' 
  AND (
    token = '6QNEgDdMrK8aTL/PSlcAbIVahEIoinAr0cophNQzqvI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035