UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TtTgnPDM80HhzKnYsDcjlq9WDqwn8TI3yXDqe6OFLHM='
WHERE
key_id = '8b21a985531c7442667b9fcf2b219051b77cf5f8cff52bc3cafa5f86021bcc9f'
AND (
token = 'TtTgnPDM80HhzKnYsDcjlq9WDqwn8TI3yXDqe6OFLHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)