UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hnahw2eVrbFH2QDJpBc5aQVBx0zDKUH/gg/cYpd79XU='
WHERE
key_id = '87c16a38f4630165975998425713c7f5272e494f799db39d454f419b32e8bbda'
AND (
token = 'hnahw2eVrbFH2QDJpBc5aQVBx0zDKUH/gg/cYpd79XU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)