UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DAcOtKO5rQKxFGY//wO1GzNgOPsIepzmEO3Tr2Zz1tQ='
WHERE
key_id = '0e887ff7aa6cfe19c57bc46edd4419f6f50022677586392a2abdaeb8e2da5913'
AND (
token = 'DAcOtKO5rQKxFGY//wO1GzNgOPsIepzmEO3Tr2Zz1tQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)