UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KcOjy+hk2r9NT/CWkKIIbIr6voPeeS5nQllpishzg98='
WHERE
key_id = '60d8f9afb4ea5ee78b77bb9303542349abdbf6cef5db79d7f5eef8e86c993816'
AND (
token = 'KcOjy+hk2r9NT/CWkKIIbIr6voPeeS5nQllpishzg98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)