UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2TNW+VC3D4nxF5M05qzLDJfnpetvMfgGqpl5mrOgE3I='
WHERE
key_id = '17572cfe27c22fa810bad8255a63ed3c799379de07a7ea32843548aee3bae670'
AND (
token = '2TNW+VC3D4nxF5M05qzLDJfnpetvMfgGqpl5mrOgE3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)