UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2etzkwZq93nSRj+Ec9gLBnJpnbYRQv/fn4uXvLcfyUc=' 
WHERE 
  key_id = 'bb14775cccf7ac0d61d0b1fb78466c0e50dae54d95722473e576e597fc15e868' 
  AND (
    token = '2etzkwZq93nSRj+Ec9gLBnJpnbYRQv/fn4uXvLcfyUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016