UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yyXyyZbNc5dnxeNuGDi72SAktLlfcjgl9ki5EMHXqB8='
WHERE
key_id = '10bfb93d311f32b7354b875e492fe191b50e172ec134df67a260203015e4846a'
AND (
token = 'yyXyyZbNc5dnxeNuGDi72SAktLlfcjgl9ki5EMHXqB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)