UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dDEkPzUmDU0bvYhxyezqsNlpf2xsuJlO/75U5muIEi8='
WHERE
key_id = '0b6e840d0ded7e6fd237e31b7eac21d38c4fcbf6bfe79cdcac0f1bf082b2f012'
AND (
token = 'dDEkPzUmDU0bvYhxyezqsNlpf2xsuJlO/75U5muIEi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)