UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/l9hpm35JEA1SHg4WJyNdcHWY/dlr8Hl/HKkstr6lmg=' 
WHERE 
  key_id = 'f6ab830a39697f318347bd958e7c5fd1b2cca3f63e1aee73a44917f887f706dd' 
  AND (
    token = '/l9hpm35JEA1SHg4WJyNdcHWY/dlr8Hl/HKkstr6lmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026