UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SWkvZD0WtmbeQYoJ//DAxSBvp1dHbT6elHKUI6h24js=' 
WHERE 
  key_id = '3851eb0ab33be9d17b3b07581c359744f8fba3245a8cc08ac7c5dc56b297ed82' 
  AND (
    token = 'SWkvZD0WtmbeQYoJ//DAxSBvp1dHbT6elHKUI6h24js=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030