UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sZcPcEH/DioKfYV8UmqTfYAy5eVM6WLNO+/k750SNQ4='
WHERE
key_id = '368e01b2315ef10d9e3072e24f5a551e1ce098bcdaf99a2ee9a8fe83cd9eff43'
AND (
token = 'sZcPcEH/DioKfYV8UmqTfYAy5eVM6WLNO+/k750SNQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)