UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h6+1SOu7wMreB8XZkBgb59Yj4vYEGA9KcVdEY1T70Pg='
WHERE
key_id = 'db6bd399023c7759f626428ac8f74adc075472ff2eeb8d9a79df4daff7c06f85'
AND (
token = 'h6+1SOu7wMreB8XZkBgb59Yj4vYEGA9KcVdEY1T70Pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)