UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v4LekR4ZaB/0/L7vweK8yi3btVzSQxZ2pRTj8h6YWcU='
WHERE
key_id = '324df840d1c6e7c32e12a9427ad210c7248f22c27f71403d8a8b842af158fa24'
AND (
token = 'v4LekR4ZaB/0/L7vweK8yi3btVzSQxZ2pRTj8h6YWcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)