UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UxyB8S+Qzcpxc5YhqBxmyRL/kcBCmHnnBExbcAxDpFM=' 
WHERE 
  key_id = '3c5ddd7368d4de47ec6b2abb7c9659ac46ded1b6ced4d68ca6978a2d25f7fe43' 
  AND (
    token = 'UxyB8S+Qzcpxc5YhqBxmyRL/kcBCmHnnBExbcAxDpFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037