UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5RLrmw7rvPu+11pWaL3rzCizv0q6+RQw7Jj6QnjmVi8=' 
WHERE 
  key_id = '6f8a26719dbd7f5070710f38ca0a292d914cb2209261a9994e8c67fcd91b52e4' 
  AND (
    token = '5RLrmw7rvPu+11pWaL3rzCizv0q6+RQw7Jj6QnjmVi8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047