UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jZiINjR5P5dsEE/ZT+nenAudMUdJF3JxSGiC3TF/Bvg=' 
WHERE 
  key_id = 'd9bd092b07f04813eacf7e43c8975723620ae7bc7a1edfeb425b0fb9bd7046ff' 
  AND (
    token = 'jZiINjR5P5dsEE/ZT+nenAudMUdJF3JxSGiC3TF/Bvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031