UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4j3nq1ndBJZGF+GWglHaEPXLyS6mWRyyvVh8bYkr4S4='
WHERE
key_id = '47e08e26ac8219f4afe6e59e3f75d058666c2e87adc0af07acead9df7f068169'
AND (
token = '4j3nq1ndBJZGF+GWglHaEPXLyS6mWRyyvVh8bYkr4S4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)