UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WvdUs9cRAPlkcCQxIgYAJNv3P9obYYshTIu2XlPCf5w=' 
WHERE 
  key_id = '0bb92f4522e669971800c469ba2146809c058b869ed798cfca1cd55faa9cbb07' 
  AND (
    token = 'WvdUs9cRAPlkcCQxIgYAJNv3P9obYYshTIu2XlPCf5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048