UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Htu1LQifJ/1Xfs9Qh66cnjIavPNnLRBQ/3NZz0wsZjQ=' 
WHERE 
  key_id = '7abacc6323a76c774a186b93f7b94c58d277e6924cd4a4e9432f23f9e008a220' 
  AND (
    token = 'Htu1LQifJ/1Xfs9Qh66cnjIavPNnLRBQ/3NZz0wsZjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027