UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dkaDgBbFqPcc+AFy+Crr8z3BlUa9QKuzEngi6VKcsl0='
WHERE
key_id = '66a233945007bc8f8c3fc8760e964c77c8bbef3b9a939ccdb840e572ccd3e025'
AND (
token = 'dkaDgBbFqPcc+AFy+Crr8z3BlUa9QKuzEngi6VKcsl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)