UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't+eFETwiOyDC0f4WJbbPkbbVkDoG8ATTNtP/vhtN2os=' 
WHERE 
  key_id = '2fe895b4ea5b33c5da3a8a99a6cbfff298b5bcda3b649462a648c8a173a4d584' 
  AND (
    token = 't+eFETwiOyDC0f4WJbbPkbbVkDoG8ATTNtP/vhtN2os=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024