UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VcyaFY2Yn04zXl2eMe3Dtx4iULZKa3GJsVDakRRxZkw='
WHERE
key_id = 'd54de39289322b7219582a6e6c8726bc24abf61dab168511432b2c77eba539e5'
AND (
token = 'VcyaFY2Yn04zXl2eMe3Dtx4iULZKa3GJsVDakRRxZkw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)