UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V/duXQt+Yd5Jf5Uhce+/WZylC+B5byglrPJnp/1v75I='
WHERE
key_id = '9f6d6785c57fc2b0904ff9123437cce7eebe8b0783a62e6fcd55ca4eb30ccba6'
AND (
token = 'V/duXQt+Yd5Jf5Uhce+/WZylC+B5byglrPJnp/1v75I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)