UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UQfg/kusALkW7rsfUtCxo2APaQTKzEGVsTWd3PjxGns='
WHERE
key_id = '58729f7430a1bec0f7fec099581dbb586019e066ef7a1b16c7fda6d1016333ac'
AND (
token = 'UQfg/kusALkW7rsfUtCxo2APaQTKzEGVsTWd3PjxGns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)