UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2yLnSrmoMciXADgfBu+I7i+ghYoZGGj80y9KuB/6yKs=' 
WHERE 
  key_id = 'f5a35c7fcae639d7cb49f5ac8bf9bfdaece31b4b102a18ed21df682b3635a0b8' 
  AND (
    token = '2yLnSrmoMciXADgfBu+I7i+ghYoZGGj80y9KuB/6yKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032