UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ck+O9vThctvUBdD1JhksWcDR8rOHvvIqXh9FjJLuJS8='
WHERE
key_id = '70777209a5fcbc6bb499ffba6a75ef52ee912fb010975b6c5da0f461ae8a0c34'
AND (
token = 'Ck+O9vThctvUBdD1JhksWcDR8rOHvvIqXh9FjJLuJS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)