UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2c1EQ5k//Obnz7z9p06SaGz+iw22rR9ZxidnVF+DyqM='
WHERE
key_id = '9cc1a28789f60e3e6a4f4ad857934ff9f93f03861312fca474b02d92c3513572'
AND (
token = '2c1EQ5k//Obnz7z9p06SaGz+iw22rR9ZxidnVF+DyqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)