UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't43EdryXUblpOGTcp0jOU9tS7cjstcJOsbJk6rE1d70='
WHERE
key_id = '4b729c7c49f544b3acd842b86ac0a0ee8409ed9a3b0bb21b9ec8c26e1440e8f0'
AND (
token = 't43EdryXUblpOGTcp0jOU9tS7cjstcJOsbJk6rE1d70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)