UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qkWidxP5Gf8bWTK5K4b7ChfgY6iWWyI46ao98oFhHgU='
WHERE
key_id = '9f7d9ed863d8542a649e2048b3708e892a9d024caaaf485d2292c465aeba21ff'
AND (
token = 'qkWidxP5Gf8bWTK5K4b7ChfgY6iWWyI46ao98oFhHgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)