UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sNfHxRd9PmMJDpQZ95o9Xh+Bs4A2UQ6YP3SCNIAXeIU='
WHERE
key_id = 'eb1c7efacd292b4077011d68aa13dc0b05653b493efc44816899a92f8912f90f'
AND (
token = 'sNfHxRd9PmMJDpQZ95o9Xh+Bs4A2UQ6YP3SCNIAXeIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)