UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wsWLZ2B3bkxNKTJ4LqBzKy2/33MxSM4hr1Z+28Rd2DA=' 
WHERE 
  key_id = '72ce5fa802fac2f06dc60c4635285aff92264be7c5ff97be360f2275e211b256' 
  AND (
    token = 'wsWLZ2B3bkxNKTJ4LqBzKy2/33MxSM4hr1Z+28Rd2DA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029