UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mVx1xZ+79060GouKPD/GXlLr9MlKUhtEjCULf3qjsw8='
WHERE
key_id = '1805738989306fce58b9e269edb2c180099d5a2d033c99f9a653f48ca41741f1'
AND (
token = 'mVx1xZ+79060GouKPD/GXlLr9MlKUhtEjCULf3qjsw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)