UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yA/y/5CX/NQfoVbY8Oy3G/qy0amkUB+oGqGXRQLqFPk=' 
WHERE 
  key_id = 'daae71987748eaada062a92977471bd2e129eb91f53f3e96236309fb84751152' 
  AND (
    token = 'yA/y/5CX/NQfoVbY8Oy3G/qy0amkUB+oGqGXRQLqFPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043