UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7eL5aYC/f92ejjwXBnCrzdQ8m9A6YjjtJsh0DbBwjQM=' 
WHERE 
  key_id = 'e393c147104d465b3da439899a0a6d82e6f68332ae2fe602105296235e496168' 
  AND (
    token = '7eL5aYC/f92ejjwXBnCrzdQ8m9A6YjjtJsh0DbBwjQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029