UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1AHcfTiCwKU2pbZT0JukEOf31pWIZ5LnzmqvWCNa/q4='
WHERE
key_id = '9dddb4987e954dae6267bc324590c08b1226a8ea010ac9995afb626df1badf18'
AND (
token = '1AHcfTiCwKU2pbZT0JukEOf31pWIZ5LnzmqvWCNa/q4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)