UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'roNvuthtaZxZHPjhGAeDtKVBQr1ZbODIXJdCvSsrHyw='
WHERE
key_id = '47125e74faa993762fd4e80960ebeb3fb8f1b98c20ba874cfde1cb9e187e1c47'
AND (
token = 'roNvuthtaZxZHPjhGAeDtKVBQr1ZbODIXJdCvSsrHyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)