UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZbI017JHlKBkfqKqxLrGSzyIKZDDWvpwRIV6L3nu/RY='
WHERE
key_id = '2e1d567929749ff9a0f4bf109dfe6d95e3efbd8202803c68d542f685d374ebaf'
AND (
token = 'ZbI017JHlKBkfqKqxLrGSzyIKZDDWvpwRIV6L3nu/RY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)