UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sUX08JdUmD/SOp0xeZUOFtLuMMBYZ9K7Xg8hW4brH9s='
WHERE
key_id = '377ec43090bd073b8e9eba35a33e1faacc1fe45e24b8f5f910699ac51f18f56f'
AND (
token = 'sUX08JdUmD/SOp0xeZUOFtLuMMBYZ9K7Xg8hW4brH9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)