UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wmgN5z8epBeaasWBL9Jld0/NeY/Do/YzReHesNeVHjU=' 
WHERE 
  key_id = 'f26a084453bb6190edd343c8355c4787d91eb1242eded40abec7d6988a9e8440' 
  AND (
    token = 'wmgN5z8epBeaasWBL9Jld0/NeY/Do/YzReHesNeVHjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029