UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uuZELRDchrN0kdKNIjonSVM0wQ3LJIiLKJsXd21pV6I=' 
WHERE 
  key_id = '5bef7bc43a36c72cae094235a0f6f14a8854cf4bf8a39ae56bbabe2e2b843bd2' 
  AND (
    token = 'uuZELRDchrN0kdKNIjonSVM0wQ3LJIiLKJsXd21pV6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033