UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'blvPBgEz6YAsIXfMyHnsq5bH+PuyImcr2tugBautctM='
WHERE
key_id = '75e9e326fb0f257269cd45577021e7a3514210bde96ed35b19708d84c3375aa4'
AND (
token = 'blvPBgEz6YAsIXfMyHnsq5bH+PuyImcr2tugBautctM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)