UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TLhS790GO7qHzNRanZDtv1Yb6dFcuB3QgX+J/XJCyu8='
WHERE
key_id = '640245de394da6827d22f402c3374d020e09f6295793896576935511a84a76fc'
AND (
token = 'TLhS790GO7qHzNRanZDtv1Yb6dFcuB3QgX+J/XJCyu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)