UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PxAlDOF6+dwBF5Nc5DY9IqEN84fk9VzMRmsQNK5MK04='
WHERE
key_id = 'ab86bdd2d7feff548a9ad652421194c3497f7b82b247203afde0eff4fe6c39bd'
AND (
token = 'PxAlDOF6+dwBF5Nc5DY9IqEN84fk9VzMRmsQNK5MK04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)